package com.sac.common.exception;

/**
 * @author xiaodong
 * @title
 * @date 2018/12/5 11:10
 * @desc
 */
public class SACUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler {
    @Override
    public void uncaughtException(Thread t, Throwable e) {
        System.out.println("[审批系统caughtException = " + e + "]");
    }

    public static void main(String[] args) {

        try{
            Thread thread = new Thread(new Runnable() {
                @Override
                public void run() {
                    System.out.println("子线程抛出运行的异常。。。。");
                    throw new RuntimeException();
                }
            });
            thread.start();
        }catch (Exception e){
            System.out.println("caughException =" + e);
        }
    }

}
